
import fs from 'fs'
import ph from 'path'
import os from 'os'
import { load } from 'js-yaml'
import { merge } from 'lodash-es'

export default function(path) {
    const p = ph.resolve(path)
    const { flag, base, environment } = load(fs.readFileSync(p, 'utf-8'))
    return merge(base, environment[process.env[flag]])
}
